package com.yami.shop.bean.vo.search;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yami.shop.bean.app.vo.SkuVO;
import com.yami.shop.bean.model.ProdLevel;
import com.yami.shop.common.serializer.json.ChainJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.util.Date;
import java.util.List;

/**
 * 功能描述: 微发行VO
 * @Author: LSR
 * @Date: 2023/4/19 18:46
 */
@Data
public class MicroreleaseProductSearchVo {

    @Schema(description = "商品id")
    private Long prodId;

    @Schema(description = "店铺id", required = true)
    private Long shopId;

    @Schema(description = "商品名称")
    private String prodName;

    @Schema(description = "商品售价")
    private Double price;

    @Schema(description = "市场价")
    private Double oriPrice;

    @Schema(description = "活动价(秒杀、团购活动的商品价格)")
    private Double activityPrice;

    @Schema(description = "详细描述")
    private String content;

    @Schema(description = "商品介绍主图")
    private String pic;

    @Schema(description = "商品视频")
    private String video;

    @Schema(description = "sku列表")
    private List<SkuVO> skuList;

    @Schema(description = "商品类型(0普通商品 1拼团 2秒杀 3积分)")
    private Integer prodType;

    @Schema(description = "商品状态")
    private Integer status;

    @Schema(description = "活动id")
    private Long activityId;

    @Schema(description = "商品类别 0.实物商品 1. 虚拟商品")
    private Integer mold;

    @Schema(description = "开售时间")
    private Date startTime;

    @Schema(description = "活动结束时间")
    private Date endTime;

    private Date putawayTime;

    @Schema(description = "限量")
    private Long circulation;

    @Schema(description = "创作者")
    private String authorName;

    @Schema(description = "创作者头像")
    private String authorImg;

    @Schema(description = "发行方")
    private String issueName;

    @Schema(description = "是否拥有权益")
    private Integer isRights;
    @Schema(description = "权益信息列表")
    private List<ProdRightSearchVO> prodRights;

    @Schema(description = "商品类型")
    private Long attr;

    @Schema(description = "大唐链地址")
    @JsonSerialize(using = ChainJsonSerializer.class)
    private String chain;

    @Schema(description = "大唐链地址CODE")
    private String chainCode;

    @Schema(description = "是否拥有该商品链上地址")
    private Boolean isHasDTCAddress;

    @Schema(description = "渠道CODE")
    private String channelCode;

    @Schema(description = "限购数/可购买数")
    private Integer maxNum;

    @Schema(description = "是否可以购买")
    private Integer isPurchase = 0;

    @Schema(description = "稀有度")
    private ProdLevel prodLevel;

    @Schema(description = "录入时间")
    private Date createTime;

    @Schema(description = "库存量(可售卖库存)")
    private Integer totalStocks;

    @JsonFormat(pattern = "MM-dd HH:mm")
    public Date getPutawayTime() {
        return putawayTime;
    }

    @Schema(description = "规则限购数")
    private Integer ruleMaxNum;

    private String indexIdPrefix;

    @Schema(description = "分账组ID")
    private Long receiverGroupId;

    @Schema(description = "是否可以领取")
    private Boolean isReceive;

    public void setPutawayTime(Date putawayTime) {
        this.putawayTime = startTime;
    }
}
